package com.jzo2o.orders.manager.config;

import com.jzo2o.api.customer.dto.response.AddressBookResDTO;
import com.jzo2o.api.foundations.AddressBookApi;

import io.netty.util.concurrent.BlockingOperationException;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author 11394
 * @version 1.0
 * @description: TODO
 * @date 2024/8/25 21:25
 */
@Component
public class CustomerClient {

    @Resource
    AddressBookApi addressBookApi;

    public AddressBookResDTO getapi(Long id){
        System.out.println("根据id查询地址簿"+id);
        //调用其他微服务的方法
        AddressBookResDTO deataoil = addressBookApi.deataoil(id);
        return deataoil;
    }

    //执行异常走
    public AddressBookResDTO resDTO(Long id,Throwable throwable){
        System.out.println("非限流，熔断等导致的移仓执行的降级方法");

        return null;
    }

    //熔断后的降级逻辑
    public AddressBookResDTO addressBookResDTO(Long id){
        return null;
    }
}
